home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
WEDITS22.ARJ
/
WEVARS.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-08-15
|
8KB
|
198 lines
UNIT WEVars;
{ -- This is the Global Variables and Types unit of WWIVEdit 2.2
-- Last updated : 8/15/91
-- Written By:
-- Adam Caldwell
--
-- This code is Public Domain.
--
-- }
{$R-,V-,S-,B-,E-,N-} { These Optomize things as much as possible }
INTERFACE
TYPE
{ These are the Editor functions that I have defined so far [None..DelEOL]
If you want to add another one, give it an identifier, define a Key for it
(which will probably have to be an ALT Key or Function key because almost
all of the control keys are full), and put that definition in GetFun().
You then have to add it to the case statement in EditText().
}
EdFun = (
None, Up, Down, Left, Right, WordLeft, WordRight, BackSpace,
DelChar, DelLine, Tab, Home, _End, Top, Bottom, InsLine,
ToggleInsert, PgUp, PgDn, Enter, WWIVColor, InsertLiteral,
CenterLine, GetHelp, AbortPost, ExitAndSave, NormalExit,
InsertChar, InsertFile, QuietExitAndSave, GoBack, EraseWordLeft,
MarkStart, MarkEnd, DeleteBlock, MoveBlock, CopyBlock,
ShowBlockStat, Jump, Find, SaveAndContinue, ToggleWhere,
DelSOL, FindLast, RedisplayAll, InsertMCI, ToggleFullScreen,
DelEOL
);
CONST
VERSION = 'Version 2.2';
TabStop=5;
MinScrollLeft = 3;
AbsoluteMaxLines = 3300;
MaxPhyLines = 50;
MaxLineLen = 80;
WarnTime = 90.0; { Number of seconds before user should be warned }
DisconnectTime = WarnTime * 2;
NormalReturnCode = 0; { The result code for '/ES' and ESC-S }
NonAnonymousReturnCode = -1; { The result code for '/ESN' }
AnonymousReturnCode = 1; { The result code for '/ESY' }
{-- It is assumed that the COMMON.PAS takes care of these Macro keys, and they
-- are defined here only so that I can remember that they are already in use }
MacroKey1 = ^D; MacroKey2 = ^F; MacroKey3 = ^A;
FastLeft = ^S; FastRight = ^E;
DelWordLeft = ^W;
BackSpaceKey= ^H; _DEL_ = #127;
ESC = #27;
RedisplayKey= ^R; DelLineKey = ^Y; TabKey = ^I;
UpKey = ^U; PgUpKey = ^T;
LeftKey = ^G; RightKey = ^Z;
DownKey = ^J; PgDnKey = ^B;
ToggleInsKey= ^V; DelKey = #127;
RepeatLastFindKey = ^L;
DelLeftKey = ^N; ToggleFullscreenKey=^];
EnterKey = ^M; WWIVColorKey = ^P;
ExtendedKey2 = ^Q; CenterLineKey = ^C;
DelSOLKey = ^X; HelpKey = ^O;
ExtendedKey1 = ^K;
EditorKeys : SET OF Char = [FastLeft, FastRight, BackSpaceKey, _DEL_,
DelLineKey, TabKey, UpKey, PgUpKey, LeftKey, ToggleInsKey,
RightKey, DownKey, PgDnKey, DelKey, RedisplayKey, RepeatLastFindKey,
EnterKey, WWIVColorKey, CenterLineKey, DelSOLKey, HelpKey,
DelLeftKey, DelWordLeft, ExtendedKey1, ExtendedKey2,
ToggleFullScreenKey];
TYPE
strng = string[MaxLineLen+1];
linetype = RECORD { Each line has a color map and a text part }
l : strng;
HardCR : Boolean;
c : strng;
END;
textbuffer = ARRAY[0..AbsoluteMaxLines] of ^linetype; { The Text buffer is
allocated from the heap }
screenbuffer = ARRAY[0..MaxPhyLines] OF linetype;
ExtTrans = array[1..3] OF char;
TransFile = FILE of ExtTrans;
CharSet = SET of Char;
PROC = PROCEDURE;
userrec = record
name : string[30]; { User's Handle }
realname : string[20]; { User's Real Name }
sl : byte; { Security Level }
END;
CharFunction = FUNCTION : char;
InfoRec = RECORD
UserName : string[20];
TagLine : ARRAY[1..3] OF String[80];
Selected : Byte; { Which was last attached }
Method : Byte; { 0=No Tag Line, 1, 2, 3=Always use #1, #2, or #3,
4=Rotate, 5=Random, 6=Method=Selected on next use }
ScreenState : Byte;
ScreenHeight : Byte;
InsertMode : Boolean;
Reserved : ARRAY[1..131] OF byte;
END;
{ -- Programmer's Note on INFOREC --
-- If you add anything to this, add it after the reserved bytes,
-- and decrement the reserved bytes accordingly. Future version of
-- WWIVEdit will add new things before Reserved, and decrement the bytes
-- accordingly... So to be the most compatible with future version,
-- Add after the Reserved
-- }
InfoF = FILE of InfoRec;
VAR
screen : ScreenBuffer; { An image of what should appear on the screen }
line : TextBuffer; { The physical text }
MaxLines : integer; { The Maximum number of lines as passed on command line }
LineLen : integer; { The Maximum line length as passed on command line }
cx, cy : integer; { The x and y coords of the cursor }
WindowTop : integer; { defines the Window Top -- physical screen line }
WindowBottom : integer;{ defines the Window Bottom -- physical screen line }
ViewTop : integer; { defines the Viewport Top -- physical Text line }
ViewBottom : integer; { defines the Viewport Bottom -- physical Text line }
WindowHeight:integer; { how tall the physical window is }
ScreenHeight:byte; { the maximum height of the screen }
FileName : string; { the name of the input/output file }
Title : string; { the title of the mesage }
Destination : string; { where the message is going }
CurrentColor : char; { the color attribute to assign to the current character }
DisplayColor : char; { The current state of ANSIC }
Local : boolean; { defines whether ceartain functions can be used }
InsertMode : boolean; { Whether or not we are in insert mode -- initialized true }
HighLine : integer; { The highest line currently in use }
LastKey : LongInt; { used to time-out the editor }
TransTable : TransFile;{ Used for Local Extended Key Macros }
OkLocalMacros :boolean;{ If BBS.KEY and MACROS.LCL exist, local macros are ok }
OkTagLines : boolean; { If there is no /T parameter on the command line, Tag Lines are ok }
AddBBSTag : boolean; { If there is no /A parameter, and the file BBS.TAG exists }
FileThere : Boolean; { If a file got loaded in at the beginning. If so, then no tag lines are added }
BlockStart : integer; { Block Marker Start (line number) }
BlockEnd : integer; { Block Marker End (line number) }
SearchString : string; { The last search string }
SearchOps : String; { The last search options }
KeyStatusFlag : BYTE ABSOLUTE $40:$17;
ColorRangeCheck : boolean;
AfterNext : PROC; { This is a hook into the ReadKey procedure. This
procedure will be executed after the next keystroke
is accepted. This is used to Clear the statline, but
can have other functions }
BeforeNext: PROC;
ScreenSize : WORD ABSOLUTE $40:$4C;
ParameterFileName:string;
InfoFile : InfoF;
CMap : ARRAY[char] OF Boolean;
AddSL : Byte; { Minimum SL to add a word to the dictionary }
MCICommands : boolean;
KeyBIOS : boolean;
NoColor : boolean;
ForceAnsi : Boolean;
ScreenState : Byte; { 0=With header and Maxlines, 1= Nothing on screen }
VAR
usernum : integer; { Current user's number }
incom : boolean; { TRUE if user is calling remotely }
thisuser : userrec; { Contains all pertinent user info }
IgnoreName : boolean;
translate : boolean; { If true, translates WWIV Color codes to }
{ ANSI codes. If WWIV is detected then }
{ this will initially be false, otherwise T }
Info : InfoRec;
FG, BG : byte; { Foreground and Background colors }
StartupDir : string; { The directory the program started up in }
AllowTitleChange : Boolean;
InDos : Boolean;
DicChanged : Boolean;
Suggestion : ARRAY [1..100] OF string[25];
PROCEDURE DoNothing;
IMPLEMENTATION
{$F+} PROCEDURE DoNothing; BEGIN END; {$F-}
END.